// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from '@/App'
import router from './router'
import Vuex from 'vuex'
import store from '@/vuex/store'
import util from '@/assets/util/util'
//引入请求
import axios from 'axios'
//引入rem实现移动端屏幕适配
import './rem'
//引入weui
import weui from 'weui.js'
import 'weui'
//引入请求封装
import { post, fetch, patch, put } from "./assets/util/http.js"
//引入jQuery
import $ from 'jquery'
//引入vue富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
//引入element-ui
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
//mint-ui
import Mint from 'mint-ui'
import 'mint-ui/lib/style.css'
import { MessageBox } from 'mint-ui'
//自定义样式
import './assets/css/custom.css'
//阿里巴巴图标样式
import  '../static/font/iconfont.css'
//按需引入vant
import { Tab, Tabs, Cell, CellGroup, Icon, SwitchCell, Image, Tag, Dialog, Field,  Tabbar, TabbarItem, Lazyload, Swipe, SwipeItem, Popup } from 'vant';
//引入移动端鼠标事件
import vueTouch from 'kim-vue-touch'
//引入vux-UI
import {ToastPlugin,LoadingPlugin,AlertPlugin} from 'vux'

Vue.use(ToastPlugin)
Vue.use(LoadingPlugin)
Vue.use(AlertPlugin)

//全局常量
import net from '@/assets/util/constants'


Vue.use(VueQuillEditor)
Vue.use(Mint)
Vue.use(Vuex)
Vue.use(ElementUI)
Vue.use(weui)
//按需引入vant
Vue.use(Image).use(Icon).use(Tag).use(Cell).use(CellGroup).use(Tab).use(Tabs)
  .use(Dialog).use(Field).use(Tabbar).use(TabbarItem).use(Lazyload,{lazyComponent:true})
  .use(Swipe).use(SwipeItem).use(Popup).use(SwitchCell );

Vue.prototype.NET = net
Vue.prototype.$weui = weui
Vue.prototype.$util = util
Vue.prototype.$store = store
//把axios对象挂到Vue实例上面，其他组件在使用axios的时候直接 this.$http就可以了 
Vue.prototype.$axios = axios
Vue.prototype.$post = post;
Vue.prototype.$fetch = fetch;
Vue.prototype.$patch = patch;
Vue.prototype.$put = put;
//mint-ui功能
Vue.prototype.$messagebox = MessageBox;
//移动端鼠标事件
Vue.use(vueTouch)
//去掉vue警告，（用于生产不提示）
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
	model: 'hash',
	el: '#app',
	router,
	components: {
		App
	},
	created() {
		if(localStorage.getItem("isLogin") === null) {
			localStorage.setItem("isLogin", '');
		}
		this.$store.isLogin = localStorage.getItem('isLogin');
	},
	template: '<App/>'
})
